import  pyotp

totp = pyotp.TOTP('base32secret3232')
print totp.now()

print totp.verify('482268')

## returns a 16 character base32 secret. Compatible with Google Authenticator and other OTP apps
print pyotp.random_base32()

print pyotp.totp.TOTP('JBSWY3DPEHPK3PXP').provisioning_uri("realm", issuer_name="Secure App")